<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:uddi="urn:uddi-org:api_v3">
	<xsl:output method="xml" encoding="UTF-8"/>

	<xsl:template match="*" mode="description">
		<xsl:variable name="descriptionCount"><xsl:value-of select="count(uddi:description)"/></xsl:variable>
		<fieldset>
			<legend>Description [<xsl:value-of select="$descriptionCount"/>]</legend>
			<xsl:if test="$descriptionCount > 0">
				<table>
					<tr>
						<th>Language code</th>
						<th>Description</th>
					</tr>
					<xsl:apply-templates select="uddi:description"/>
				</table>
			</xsl:if>
		</fieldset>
	</xsl:template>

	<!-- Match the description UDDI element -->
	<xsl:template match="uddi:description">
		<tr>
			<td><xsl:value-of select="@xml:lang"/></td>
			<td><xsl:value-of select="."/></td>
		</tr>
	</xsl:template>
</xsl:stylesheet>